package com.ican.oc.dao;

import org.springframework.stereotype.Repository;

import com.ican.oc.common.hibernate.OcHibernateDao;
import com.ican.oc.domain.OcProductOption;

@Repository("ocProductOptionDao")
public class OcProductOptionDao extends OcHibernateDao<OcProductOption, Integer> {

    public OcProductOption findOcProductOption(Integer productId, Integer optionId){
        String hql = "from OcProductOption where productId = " + productId + " and optionId = " + optionId;
        return this.findUnique(hql);
    }
    
    public void updateOcProductOption(Integer productOptionId, String optionValue){
        String hql = "update OcProductOption set optionValue = '" + optionValue + "' where productOptionId = " + productOptionId;
        this.batchExecute(hql);
    }
}
